﻿
CREATE PROCEDURE [dbo].[SYS_ServiceConfiguration_FetchConfigurationsByService]
(
	@Service  varchar(50),
	@Status int
)

AS

IF(@Status=0)
BEGIN

	SELECT 		
		c.[ConfigurationId],
		c.[Service],
		c.[Type],
		c.[Value],
		c.[Status]
	    FROM dbo.SYS_ServiceConfiguration c
		ORDER BY c.UpdateDate DESC

END
IF(@Status>0)
BEGIN

	SELECT 		
		c.[ConfigurationId],
		c.[Service],
		c.[Type],
		c.[Value],
		c.[Status]
	    FROM dbo.SYS_ServiceConfiguration c
		WHERE c.[Status]=@Status
		ORDER BY c.UpdateDate DESC
		
END

